<?php
get_header();
if (have_posts()):
?>

<?php htmlUA('<div id="body">','<section id="body">'); ?>

<?php
while (have_posts()) : the_post();
?>

<?php
htmlUA('<div id="article">','<article>');
?>
	
	<div class="title">
		<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
		<div class="sprite">
			<strong><?php the_author(); ?></strong> wrote on <?php the_time('Y-m-d'); ?> under <?php the_category(', '); ?> | <?php 
			if (!comments_open()) {
				_e( 'Comments are closed.');
			} else {
				comments_popup_link(__('Leave a comment'), __('1 Comments'), __('% Comments'));
			}
			?>
		</div>
	</div>
	
	<div class="content"><?php the_content(__('Read more')); ?></div>

<?php htmlUA('</div>','</article>'); ?>

<?php comments_template(); // Get wp-comments.php template ?>

<?php endwhile; ?>

<?php  if (function_exists('par_pagenavi')) : ?>
<?php htmlUA('<div id="pagenavi">','<nav id="pagenavi">'); ?>
    <ul><?php par_pagenavi(5); ?></ul>
<?php htmlUA('</div>','</nav>'); ?>
<?php endif; ?>

<?php htmlUA('</div>','</section>'); ?>

<?php else: ?>

<p class="nocontent"><?php _e('Sorry, no posts matched your criteria.'); ?></p>

<?php
endif;
?>

<?php
get_sidebar();
get_footer();
?>